﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LowLevelGraphics.Filter
{
    /// <summary>
    /// Grassfire
    /// </summary>
    public class GrassFire : BaseImageFilter
    {
        /// <summary>
        /// Default constructor
        /// </summary>
        public GrassFire()
        {
        }

        /// <summary>
        /// Grassfire
        /// </summary>
        /// <param name="_grassFire"></param>
        internal GrassFire(GrassFire _grassFire)
        {
        }

        /// <summary>
        /// Executes this instance
        /// </summary>
        /// <param name="_bitmap"></param>
        /// <returns></returns>
        public override UnsafeBitmap Execute(UnsafeBitmap _bitmap)
        {
             //for each row in image left to right
             //   for each column in image top to bottom
             //     if(pixel is in region){
             //       set pixel to 1 + minimum value of the north and west neighbours
             //     }else{
             //       set pixel to zero
             //     }
             //   }
             // }
 
             // for each row right to left
             //   for each column bottom to top
             //     if(pixel is in region){
             //       set pixel to min(value of the pixel,1 + minimum value of the south and east neighbours)
             //     }else{
             //       set pixel to zero
             //     }
             //   }
             // }
            return base.Execute(_bitmap);
        }

        /// <summary>
        /// Clones this instance
        /// </summary>
        /// <returns></returns>
        public override object Clone()
        {
            return new GrassFire(this);
        }
    }
}
